package moe.oil.dto.school;

import lombok.Data;
import lombok.experimental.Accessors;
import moe.oil.dto.user.UserDTO;
import moe.oil.validation.grop.OnUpdate;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.Instant;

@Data
@Accessors(chain = true)
@Validated({OnUpdate.class}) //todo 怎么写
public class CommentsDTO {

    @NotNull
    private Long commentId;

    @NotNull
    private UserDTO userDTO;

    private  Instant createTime;

    @NotNull
    @NotBlank
    private String message;

    @Valid
    @NotNull
    private SchoolDTO schoolDTO = new SchoolDTO();
}
